<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="test">
        hello world
    </div>
    <script>
        var test = document.getElementById("test");
        test.onclick = function(){
            this.innerHTML = "<p><br>change</p>";//innerHTML可识别引号中嵌套的标签
            // this.textContent = "<p>change</p>";//textContent不可识别引号中嵌套的标签
        }
    </script>
</body>
</html>